<template>
  <div class="container">
    <div class="not-found">
      <img class="img" src="~@/assets/img/404.png" />
      <div class="btn">
        <el-button type="primary" @click="handleBackHome">返回首页</el-button>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'

export default defineComponent({
  name: 'NotFound',
  setup() {
    const router = useRouter()
    const handleBackHome = () => {
      router.replace('/')
    }

    return { handleBackHome }
  }
})
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  background-color: #fff;

  .not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 0;

    .btn {
      margin-top: 30px;
    }
  }
}
</style>
